home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / util / misc / aterminfo.lha / doc / term.doc next >
Encoding:
Text File  |  1993-12-07  |  5.8 KB  |  134 lines

  1.  
  2.  
  3.  
  4. TERM(5)                            TERM(5)
  5.  
  6.  
  7. NAME
  8.        term - format of compiled terminfo file.
  9.  
  10. SYNOPSIS
  11.        term
  12.  
  13. DESCRIPTION
  14.        Compiled terminfo descriptions are placed under the direc-
  15.        tory /usr/lib/terminfo.    In order to avoid a linear search
  16.        of  a  huge  UNIX  directory,  a two level scheme is used:
  17.        /usr/lib/terminfo/c/name where name is  the  name  of  the
  18.        terminal,  and  c  is  the first character of name.  Thus,
  19.        act4 can  be found in the file `/usr/lib/terminfo/a/act4'.
  20.        Synonyms for the same terminal are implemented by multiple
  21.        links to the same compiled file.
  22.  
  23.        The  format has been chosen so that it will be the same on
  24.        all hardware.  An 8 or more bit byte is    assumed,  but  no
  25.        assumptions  about  byte  ordering or  sign extension  are
  26.        made.
  27.  
  28.        The compiled file is created with  the  tic  program,  and
  29.        read  by    the  routine setupterm.   Both of these pieces of
  30.        software are part of ncurses(3).     The file is divided into
  31.        six parts: the header, terminal names, boolean flags, num-
  32.        bers, strings, and string table.
  33.  
  34.        The header section begins the file.  This section contains
  35.        six  short  integers in the format described below.  These
  36.        integers are (1) the magic number (octal    0432);   (2)  the
  37.        size,  in  bytes,  of the names section; (3) the number of
  38.        bytes in the boolean section;  (4)  the    number    of  short
  39.        integers in the numbers section; (5) the number of offsets
  40.        (short integers) in the strings section; (6) the size,  in
  41.        bytes, of the string table.
  42.  
  43.        Short  integers    are stored in two 8 bit bytes.    The first
  44.        byte contains the least significant 8 bits of  the  value,
  45.        and  the second byte contains the most significant 8 bits.
  46.        (Thus, the value represented  is    256*second+first.)   The
  47.        value  -1  is  represented  by  0377, 0377, other negative
  48.        value are illegal.  -1 generally means that  a  capability
  49.        is missing from this terminal.  Note that this format cor-
  50.        responds to the hardware of the VAX and PDP-11.   Machines
  51.        where  this  does  not correspond to the hardware read the
  52.        integers as two bytes and compute the result.
  53.  
  54.        The terminal names section comes next.    It  contains  the
  55.        first  line of the terminfo description, listing the vari-
  56.        ous names for the terminal, separated by the  `|'  charac-
  57.        ter.   The section is terminated with an ASCII NUL charac-
  58.        ter.
  59.  
  60.        The boolean flags have one byte for each flag.  This  byte
  61.        is  either  0  or 1 as the flag is present or absent.  The
  62.        capabilities are in the same order as the file <term.h>.
  63.  
  64.        Between the boolean section and the number section, a null
  65.        byte  will  be  inserted, if necessary, to ensure that the
  66.        number section begins on an even byte.  All short integers
  67.        are aligned on a short word boundary.
  68.  
  69.        The numbers section is similar to the flags section.  Each
  70.        capability takes up two bytes,  and is stored  as a  short
  71.        integer.  If  the value represented is -1,  the capability
  72.        is taken to be missing.
  73.  
  74.        The strings section is also similar.  Each  capability  is
  75.        stored  as  a short integer, in the format above.  A value
  76.        of -1 means  the capability  is  missing.  Otherwise,  the
  77.        value  is  taken    as  an    offset from  the beginning of the
  78.        string table.  Special characters in ^X or \c notation are
  79.        stored  in their interpreted form, not the printing repre-
  80.        sentation.  Padding information $<nn> and parameter infor-
  81.        mation %x are stored intact in uninterpreted form.
  82.  
  83.        The  final  section  is the string table.  It contains all
  84.        the values of string capabilities referenced in the string
  85.        section.    Each string is null terminated.
  86.  
  87.        Note that it is possible for setupterm to expect a differ-
  88.        ent set of capabilities than are actually present  in  the
  89.        file.   Either  the  database  may have been updated since
  90.        setupterm has been recompiled (resulting in extra unrecog-
  91.        nized  entries  in  the file) or the program may have been
  92.        recompiled more recently than  the  database  was  updated
  93.        (resulting  in  missing    entries).  setupterm must be pre-
  94.        pared for both possibilities - this is why the numbers and
  95.        sizes are included.  Also, new capabilities must always be
  96.        added at the end of the    lists  of  boolean,  number,  and
  97.        string capabilities.
  98.  
  99.        As  an  example,    an octal dump of the description for the
  100.        Microterm ACT 4 is included:
  101.  
  102.        microterm|act4|microterm act iv,
  103.        cr=^M, cud1=^J, ind=^J, bel=^G, am, cub1=^H,
  104.        ed=^_, el=^^, clear=^L, cup=^T%p1%c%p2%c,
  105.        cols#80, lines#24, cuf1=^X, cuu1=^Z, home=^],
  106.  
  107. 000 032 001    \0 025    \0  \b    \0 212    \0   "    \0   m    i   c    r
  108. 020   o    t   e    r   m    |   a    c   t    4   |    m   i    c   r    o
  109. 040   t    e   r    m    a   c    t    i   v    \0  \0 001  \0    \0
  110. 060  \0    \0  \0    \0  \0    \0  \0    \0  \0    \0  \0    \0  \0    \0  \0    \0
  111. 100  \0    \0   P    \0 377 377 030    \0 377 377 377 377 377 377 377 377
  112. 120 377 377 377 377  \0    \0 002    \0 377 377 377 377 004    \0 006    \0
  113. 140  \b    \0 377 377 377 377  \n    \0 026    \0 030    \0 377 377 032    \0
  114. 160 377 377 377 377 034    \0 377 377 036    \0 377 377 377 377 377 377
  115. 200 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377 377
  116. *
  117. 520 377 377 377 377    \0 377 377 377 377 377 377 377 377 377 377
  118. 540 377 377 377 377 377 377 007    \0  \r    \0  \f    \0 036    \0 037    \0
  119. 560 024    %   p    1   %    c   %    p   2    %   c    \0  \n    \0 035    \0
  120. 600  \b    \0 030    \0 032    \0  \n    \0
  121.  
  122.        Some limitations: total    compiled  entries  cannot  exceed
  123.        4096 bytes.  The name field cannot exceed 128 bytes.
  124.  
  125. FILES
  126.        /usr/lib/terminfo/*/*    compiled terminal capability data
  127.        base
  128.  
  129. SEE ALSO
  130.        terminfo(5), ncurses(3)
  131.  
  132.  
  133.  
  134.